package com.situ.day7;

//实体类：和数据库表一一对应
public class Student extends Person{
//    private int id;
//    private String name;
//    private int age;
    private String className;

    //重载
    public Student() {
        super();//new Person();
    }

    public Student(int id, String name, int age, String className) {
        super(id, name, age);//new Person(id,name,age)
        this.className = className;
    }

//    public void show() {
//        System.out.println("Student.show");
//    }

    public void study() {
        System.out.println(className + "班的"+name+"正在学习");
    }

    @Override
    public String toString() {
        return "Student{" +
                "className='" + className + '\'' +
                ", id=" + id +
                ", name='" + name + '\'' +
                ", age=" + age +
                '}';
    }
}
